Clearlove:
import requests
class TestInteface:
    def __init__(self,method,url,data=''):
        if method == 'post':
            self.res = requests.post(url,data)
        else:
             self.res = requests.get(url)
    #反返回的结果转成json
    def get_content(self):
        return self.res.json()

#测试登录
#调用发送验证码通过手机号获取验证码
testinterface = TestInteface('post','http://localhost:5000/users/sendsms',{'mobile':18210208326})
#获取结果
res = testinterface.get_content()
#判断
if res['code'] == 200:
    #从结果集中获取验证码
    code = res['smscode']
    #调用登录接口传入手机号和验证码
    interface = TestInteface('post','http://localhost:5000/users/login',{'mobile':18210208326,'code':code})
    res = interface.get_content()
    print(res)

Clearlove:
from selenium import webdriver
from selenium.webdriver import ActionChains

# deiver = webdriver.Chrome('D:/Chrome/Application/chromedriver.exe')
# deiver.get('http://www.baidu.com')
class TestUI:
    def __init__(self):
        self.driver = webdriver.Chrome('D:/Chrome/Application/chromedriver.exe')

    # 注册测试功能
    def testReg(self):
        # 打开测试网页
        self.driver.get('http://localhost:8080/reg')
        # 自动输入内容
        self.driver.find_element_by_name('username').send_keys('kkk')
        self.driver.find_element_by_name('password').send_keys('123')
        self.driver.find_element_by_name('mobile').send_keys('13013286087')
        action = ActionChains(self.driver)
        #获取圆形球
        ball = self.driver.find_element_by_class_name('dv_handler')
        #按住不动
        action.click_and_hold(ball).perform()
        #往右滑动
        action.move_by_offset(280,0).perform()
        #自动提交按钮
        self.driver.find_element_by_class_name('van-button').click()
text = TestUI()
text.testReg()

Clearlove:
import requests
import json
reg = requests.post('http://127.0.0.1:5000/users/reg',{'username':'z1111s','password':'123','mobile':13131563903})

print(reg.text)